Skip to content

build: Upgrade depends to Qt6 - #231

Open
kwsantiago wants to merge 47 commits into
bitcoinknots:29.x-knotsfrom
privkeyio:kwsantiago/qt6-depends-upgrade
Open

kwsantiago wants to merge 47 commits into
bitcoinknots:29.x-knotsfrom
privkeyio:kwsantiago/qt6-depends-upgrade

Conversation

@kwsantiago

@kwsantiago kwsantiago commented Nov 5, 2025 •

Copy link
Copy Markdown

Upgrades the depends system to build Qt 6.7.3, preparing the codebase for Qt6 compatibility.

Changes

  • Add Qt6 (6.7.3) package definitions and patches
  • Update Qt build configuration to support both Qt5 and Qt6
  • Add automatic Qt version detection in depends toolchain
  • Add libxcb_util_cursor package for Qt6 Linux builds
  • Remove obsolete Qt5-specific patches

Details

This PR modernizes the Qt dependency infrastructure without changing application behavior. The Qt6 upgrade provides:

  • Long-term Qt support (Qt5 reaches end-of-life in 2025)
  • Better compatibility with modern platforms
  • Foundation for future Qt6-specific features

@luke-jr

luke-jr commented Nov 8, 2025

Copy link
Copy Markdown
Collaborator

This shouldn't have the wintaskbar changes - isolate that to the other PR

@kwsantiago
kwsantiago force-pushed the kwsantiago/qt6-depends-upgrade branch from 32ad8cd to a975bc0 Compare November 9, 2025 00:53
@kwsantiago
kwsantiago force-pushed the kwsantiago/qt6-depends-upgrade branch 2 times, most recently from 0b5e2aa to ed0e1fc Compare November 16, 2025 01:34
@kwsantiago
kwsantiago marked this pull request as ready for review January 8, 2026 20:37
@luke-jr

luke-jr commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

Annoyingly, it looks like Qt does not allow open source projects to use LTS or even stable branches, which forces us to be the guinea pigs... only their latest version (currently 6.10.2) is up to date on fixes.

Which leads me to think we might actually be better off with 5.15. We still have to track security vulnerabilities for it somewhat manually (Qt is still maintaining it commercially), but at least there isn't a constant wave of new features introducing new bugs.

The problem then is that Qt 5 isn't up to par on HiDPI or "dark mode" support. So in the end, Qt 6 is the only real option. :(

But let's try to at least stay close to Core on this for now. I'm expecting a branch to look like this: v29.3.knots20260203rc1...luke-jr:bitcoin:knots-qt6-experiment-20260204

Mind you, that branch does NOT build currently (due to some freetype issue). But it would be a good starting point to remake this with.

luke-jr and others added 21 commits February 16, 2026 15:13
This reverts commit bd4eee5, reversing
changes made to 91f80d5.
This change helps avoid patch duplication between a package and its
native counterpart.

Github-Pull: bitcoin#30997
Rebased-From: 0268f52
Unlike Qt 5, Qt 6 requires a separate native Qt build for
cross-building.

See: https://www.qt.io/blog/qt-6-build-system.

Github-Pull: bitcoin#30997
Rebased-From: ab399c4
1. Do not set `C{PLUS}_INCLUDE_PATH` variables

The build system for Qt 6 differs entirely from that of Qt 5. Building a
set of native Qt 6 tools now forms a separate step when cross-compiling.
Under these new circumstances, the `C{PLUS}_INCLUDE_PATH` environment
variables may alter the default include directories for both native and
cross compilers.

Previously, we explicitly unset these variables when invoking clang for
cross-compiling; however, that approach proved suboptimal (see bitcoin#30451).

This change sets the native toolchain for dependencies explicitly,
rather than relying on the `C{PLUS}_INCLUDE_PATH` environment variables.
Additionally, it facilitates the transition towards using clang for
building native tools when cross-compiling for macOS.

2. Add `ninja` package.

3. Adjust allowed symbol lists.

Github-Pull: bitcoin#30997
Rebased-From: 551e13a
Github-Pull: bitcoin#30997
Rebased-From: 30dd1f1
Github-Pull: bitcoin#30997
Rebased-From: 6d42149
On older systems, such as Ubuntu 22.04, `qt6-tools-dev-tools` and
`libgl-dev` are not treated as dependencies of `qt6-tools-dev` and
`qt6-base-dev`, respectively. This change explicitly lists them in the
installation documentation.

Github-Pull: bitcoin#32211
Rebased-From: 2e751f5
This change updates the vcpkg manifest baseline from the "2024.09.30
Release" to the "2025.03.19 Release", with the following package
changes:
 - boost: 1.85.0#1,2 --> 1.87.0
 - qtbase: 6.7.2#3 -> 6.8.2#1
 - qttools: 6.7.2#1 -> 6.8.2
 - sqlite3: 3.46.1 --> 3.49.1

Github-Pull: bitcoin#32213
Rebased-From: fe5a6dc
This change makes vcpkg skip unused features such as `dnslookup`,
`openssl`, etc.

Github-Pull: bitcoin#32213
Rebased-From: d85895e
This change fixes cross-compilation from macOS to macOS with another
architecture.

Github-Pull: bitcoin#32215
Rebased-From: 690f5da
Extend `getFrameworks()` with an optional `rpath` parameter to replace
`@rpath` in dependency paths. This fixes resolution of framework
dependencies when using Homebrew's `qt@6` package.

Github-Pull: bitcoin#32287
Rebased-From: 938208d
Homebrew’s `qt@6` package places the `translations` and `plugins`
directories in the `share/qt` subdirectory.
This change updates the `macdeployqtplus` script accordingly.

Github-Pull: bitcoin#32287
Rebased-From: fad57e9
fanquake and others added 9 commits February 16, 2026 15:15
Otherwise we end up with ~1.5GB of binaries (Linux) when DEBUG=1..

Github-Pull: bitcoin#33304
Rebased-From: c9d5f21
Modern Ubuntu isn't shipping with this library installed by default.
Staticly link it to remove the need for end-users to install it.

Closes bitcoin#33432.

Github-Pull: bitcoin#33434
Rebased-From: eca5085
Replace the unreliable https://code.qt.io with the GitHub mirror link.

Github-Pull: bitcoin#33918
Rebased-From: 50cbde3
@kwsantiago
kwsantiago force-pushed the kwsantiago/qt6-depends-upgrade branch from ed0e1fc to c7365fb Compare February 16, 2026 20:17
@kwsantiago

kwsantiago commented Feb 16, 2026 •

Copy link
Copy Markdown
Author

@luke-jr Rebased on your branch. Issue was dbus/wayland, not freetype. Builds now with 6.10.2

- chmod +x CentOS Qt5 CI setup script (lint-files.py)
- add NO_QR=1 to CentOS DEP_OPTS so toolchain sets WITH_QRENCODE=OFF
  (qrencode not built by depends when NO_QT=1)
- add compiler-rt __isPlatformVersionAtLeast shim for macOS cross builds
  (Qt6 Cocoa plugin uses @available() which needs this compiler builtin
  not available when cross-compiling from Linux with clang + lld)
Comment thread .github/workflows/ci.yml
Comment on lines +87 to 90
sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
- name: Compile and run tests
run: |
# Run tests on commits after the last merge commit and before the PR head commit

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From CodeRabbit:

Keep -DWARN_INCOMPATIBLE_BDB=OFF in this job

.github/workflows/ci.yml:92 still configures WITH_BDB=ON, and CMakeLists.txt fatal-errors on non-4.8 BDB unless this flag is disabled. libdb++-dev on Ubuntu 24.04 is BDB 5.3, so dropping it will make this CI leg fail at configure time.

Comment thread depends/packages/qt.mk
Comment on lines +121 to +126
$(package)_config_opts += -no-feature-designer
$(package)_config_opts += -no-feature-pixeltool
$(package)_config_opts += -no-feature-qdoc
$(package)_config_opts += -no-feature-qtattributionsscanner
$(package)_config_opts += -no-feature-qtdiag
$(package)_config_opts += -no-feature-qtplugininfo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From CodeRabbit:

Make extraction directory creation idempotent.

After a partial extraction, rerunning this recipe fails at mkdir qtbase (or the other plain mkdir calls) instead of reusing the existing directories. Use mkdir -p so interrupted dependency builds can be retried.

  • mkdir qtbase && \
  • mkdir -p qtbase &&
    ...
  • mkdir qttranslations && \
  • mkdir -p qttranslations &&
    ...
  • mkdir qttools && \
  • mkdir -p qttools &&
    ...
  • mkdir cmake && \
  • mkdir -p cmake && \

Comment thread doc/build-freebsd.md

#### GUI Dependencies
###### Qt5
###### Qt6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From CodeRabbit:

Fix the heading level jump.

Line 65 uses H6 immediately under the H4 GUI Dependencies heading, skipping H5 and triggering markdownlint MD001. Use ##### Qt6.

Comment thread doc/build-netbsd.md

#### GUI Dependencies
###### Qt5
###### Qt6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Code Rabbit:

Fix the heading level jump.

Line 67 uses H6 immediately under the H4 GUI Dependencies heading, skipping H5 and triggering markdownlint MD001. Use ##### Qt6.

Comment thread doc/build-openbsd.md

#### GUI Dependencies
###### Qt5
###### Qt6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Code Rabbit:

Fix the heading level jump.

Line 67 uses H6 immediately under the H4 GUI Dependencies heading, skipping H5 and triggering markdownlint MD001. Use ##### Qt6.

Comment thread doc/build-unix.md

sudo apt install qtwayland5
sudo apt install qt6-wayland

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From CodeRabbit:

Use fenced code blocks for the new commands.

Lines 85-89 and 140-144 use indented code blocks, triggering markdownlint MD046. Convert each command block to a fenced bash block.

Also applies to: 140-144

Comment thread doc/dependencies.md
Comment on lines 33 to +35
| [MiniUPnPc](../depends/packages/miniupnpc.mk) (networking) | [link](https://miniupnp.tuxfamily.org/) | [2.2.7](https://github.com/bitcoin/bitcoin/pull/29707) | 2.1 | No |
| [qrencode](../depends/packages/qrencode.mk) (gui) | [link](https://fukuchi.org/works/qrencode/) | [4.1.1](https://github.com/bitcoin/bitcoin/pull/27312) | N/A | No |
| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/archive/qt/) | 5.15.18 | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No |
| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/archive/qt/) | [6.7.3](https://github.com/bitcoin/bitcoin/pull/30997) | [6.2](https://github.com/bitcoin/bitcoin/pull/30997) | No |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From CodeRabbit:

Use descriptive link labels.

The touched rows still use generic [link] text, triggering MD059 and reducing accessibility. Replace it with labels such as [MiniUPnP], [qrencode], and [Qt].

@pdath

pdath commented Jul 11, 2026

Copy link
Copy Markdown

A "bit" from CodeRabbit for .github/workflows/ci.yml:

Workflow has no explicit permissions: block.

zizmor flags this job as running with default (overly broad) GITHUB_TOKEN permissions since no permissions: block is defined at the workflow or job level. Scoping this down (e.g., contents: read) follows least-privilege practice for the token used by these steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants